Object.defineProperty(exports, "__esModule", { value: !0 }),
  (exports.positionSearch =
    exports.exhibitSearch =
    exports.collectionSearch =
      void 0);
var e = i(require("../@babel/runtime/regenerator")),
  t = require("../@babel/runtime/helpers/objectSpread2"),
  r = require("../@babel/runtime/helpers/asyncToGenerator"),
  n = (function (e) {
    if (e && e.__esModule) return e;
    if (null === e || ("object" != typeof e && "function" != typeof e))
      return { default: e };
    var t = u();
    if (t && t.has(e)) return t.get(e);
    var r = {},
      n = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for (var a in e)
      if (Object.prototype.hasOwnProperty.call(e, a)) {
        var o = n ? Object.getOwnPropertyDescriptor(e, a) : null;
        o && (o.get || o.set) ? Object.defineProperty(r, a, o) : (r[a] = e[a]);
      }
    (r.default = e), t && t.set(e, r);
    return r;
  })(require("./base/api")),
  a = require("@/utils/index"),
  o = i(require("dayjs"));
function u() {
  if ("function" != typeof WeakMap) return null;
  var e = new WeakMap();
  return (
    (u = function () {
      return e;
    }),
    e
  );
}
function i(e) {
  return e && e.__esModule ? e : { default: e };
}
(exports.positionSearch = (function () {
  var o = r(
    e.default.mark(function r(o) {
      var u, i, s;
      return e.default.wrap(function (e) {
        for (;;)
          switch ((e.prev = e.next)) {
            case 0:
              return (e.next = 2), n.postPointsSearch(o);
            case 2:
              return (
                0 === (s = e.sent).code &&
                  null !== (u = s.data) &&
                  void 0 !== u &&
                  null !== (i = u.list) &&
                  void 0 !== i &&
                  i.length &&
                  (s.data.list = s.data.list.map(function (e) {
                    var r = e.name,
                      n = r;
                    return t(
                      t({}, e),
                      {},
                      {
                        type: 1,
                        keyName: (0, a.getKeyword)(r, o.keyword),
                        searchName: (0, a.getKeyword)(n, o.keyword),
                      },
                    );
                  })),
                e.abrupt("return", s)
              );
            case 5:
            case "end":
              return e.stop();
          }
      }, r);
    }),
  );
  return function (e) {
    return o.apply(this, arguments);
  };
})()),
  (exports.exhibitSearch = (function () {
    var u = r(
      e.default.mark(function r(u) {
        var i, s, c;
        return e.default.wrap(function (e) {
          for (;;)
            switch ((e.prev = e.next)) {
              case 0:
                return (e.next = 2), n.postExhibitionSearch(u);
              case 2:
                return (
                  0 === (c = e.sent).code &&
                    null !== (i = c.data) &&
                    void 0 !== i &&
                    null !== (s = i.list) &&
                    void 0 !== s &&
                    s.length &&
                    (c.data.list = c.data.list.map(function (e) {
                      var r = e.name,
                        n = r;
                      return (
                        2 === e.category &&
                          (e.start_day && e.end_day
                            ? (0, o.default)().isBefore(e.start_day)
                              ? (e.onShow = 0)
                              : (0, o.default)().isAfter(e.start_day) &&
                                  (0, o.default)().isBefore(e.end_day)
                                ? (e.onShow = 1)
                                : (0, o.default)().isAfter(e.end_day) &&
                                  (e.onShow = 2)
                            : (e.onShow = 3)),
                        t(
                          t({}, e),
                          {},
                          {
                            type: 2,
                            keyName: (0, a.getKeyword)(r, u.keyword),
                            searchName: (0, a.getKeyword)(n, u.keyword),
                          },
                        )
                      );
                    })),
                  e.abrupt("return", c)
                );
              case 5:
              case "end":
                return e.stop();
            }
        }, r);
      }),
    );
    return function (e) {
      return u.apply(this, arguments);
    };
  })()),
  (exports.collectionSearch = (function () {
    var o = r(
      e.default.mark(function r(o) {
        var u, i, s;
        return e.default.wrap(function (e) {
          for (;;)
            switch ((e.prev = e.next)) {
              case 0:
                return (e.next = 2), n.postExhibitSearch(o);
              case 2:
                return (
                  0 === (s = e.sent).code &&
                    null !== (u = s.data) &&
                    void 0 !== u &&
                    null !== (i = u.list) &&
                    void 0 !== i &&
                    i.length &&
                    (s.data.list = s.data.list.map(function (e) {
                      var r = e.name,
                        n = r;
                      return t(
                        t({}, e),
                        {},
                        {
                          type: 3,
                          keyName: (0, a.getKeyword)(r, o.keyword),
                          searchName: (0, a.getKeyword)(n, o.keyword),
                        },
                      );
                    })),
                  e.abrupt("return", s)
                );
              case 5:
              case "end":
                return e.stop();
            }
        }, r);
      }),
    );
    return function (e) {
      return o.apply(this, arguments);
    };
  })());
